#ifndef SOUNDMANAGER_H
#define SOUNDMANAGER_H

#include "ResourceManager.h"
#include "Sound.h"

namespace Cvekas {

// TODO: global volume setting

/// Manages audio resources
class SoundManager : public ResourceManager<SoundPtr>
{
public:
	/// Constructor
	SoundManager(HWND window_handle);

	/// Destructor
	~SoundManager();

	/// Loads sound sample into memory from file
	/// \param name Sample name
	/// \param filename Sample filename
	SoundPtr loadSample(const std::string& name, const std::string& filename);

	/// Loads new sound stream from file
	/// \param name Stream name
	/// \param filename Stream filename
	SoundPtr loadStream(const std::string& name, const std::string& filename);

	/// Updates playback buffer. Must be called each frame, Application takes care of this.
	void update();
};

typedef boost::shared_ptr<SoundManager> SoundManagerPtr;

} // namespace

#endif